<?php

class Tool
{

    //显示html过滤
    static public function htmlString($_date)
    {
        $_string = '';

        if (is_array($_date)) {
            foreach ($_date as $_key => $_value) {
                $_string[$_key] = Tool::htmlString($_value); //递归
            }
        } elseif (is_object($_date)) {
            foreach ($_date as $_key => $_value) {
                $_string->$_key = Tool::htmlString($_value); //递归
            }
        } else {
            $_string = htmlspecialchars($_date);
        }
        return $_string;
    }

}

?>